

#ifndef __ZAXBOILER_H_
#define __ZAXBOILER_H_

#ifndef ZXAUTOEXP
#ifdef ZXAUTO_DLL
    #define ZXAUTOEXP __declspec(dllexport)
#else
    #define ZXAUTOEXP __declspec(dllimport)
#endif
#endif

#include "zaxobjref.h"
#include "zadesk.h"

#ifdef _ZSOFT_WINDOWS_
DEFINE_GUID(IID_IUcadBaseObject, 
0x4a54e06b, 0x820b, 0x42fc, 0xba, 0xe1, 0x91, 0x10, 0x0e, 0x6d, 0xf2, 0xad);

#undef INTERFACE
#define INTERFACE IUcadBaseObject

interface DECLSPEC_UUID("4A54E06B-820B-42FC-BAE1-91100E6DF2AD") 
IUcadBaseObject : public IUnknown
{
    
    STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
    STDMETHOD_(ULONG, AddRef)(THIS) PURE;
    STDMETHOD_(ULONG, Release)(THIS) PURE;

    STDMETHOD(SetObjectId)(THIS_ UcDbObjectId& objId, 
                           UcDbObjectId ownerId = UcDbObjectId::kNull, 
                           ZTCHAR* keyName = NULL) PURE;
    STDMETHOD(GetObjectId)(THIS_ UcDbObjectId* objId) PURE;
    STDMETHOD(Clone)(THIS_ UcDbObjectId ownerId, LPUNKNOWN* pUnkClone) PURE;
    STDMETHOD(GetClassID)(THIS_ CLSID& clsid) PURE;
    STDMETHOD(NullObjectId)(THIS) PURE;
    STDMETHOD(OnModified)(THIS) PURE;
};

typedef IUcadBaseObject* LPUCADBASEOBJECT;

DEFINE_GUID(IID_IUcadBaseObject2,
0xf6abc0a4, 0x748a, 0x4bc0, 0xa6, 0xb0, 0x7d, 0x25, 0xd7, 0x00, 0x13, 0x90);

interface DECLSPEC_UUID("F6ABC0A4-748A-4BC0-A6B0-7D25D7001390") 
IUcadBaseObject2 : public IUnknown       
{
    
    STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
    STDMETHOD_(ULONG, AddRef)(THIS) PURE;
    STDMETHOD_(ULONG, Release)(THIS) PURE;

    STDMETHOD(ForceDbResident)(THIS_ VARIANT_BOOL* forceDbResident) PURE;
    STDMETHOD(AddToDb)(THIS_ UcDbObjectId& objId, 
                       UcDbObjectId ownerId = UcDbObjectId::kNull,
                       ZTCHAR* keyName = NULL) PURE;
    STDMETHOD(CreateObject)(THIS_ UcDbObjectId ownerId = UcDbObjectId::kNull,
                            ZTCHAR* keyName = NULL) PURE;
    STDMETHOD(ObjectExists)(THIS_ VARIANT_BOOL* objectExists) PURE;
    STDMETHOD(SetObject)(THIS_ UcDbObject*& pObj) PURE;
    STDMETHOD(GetObject)(THIS_ UcDbObject*& pObj) PURE;
    STDMETHOD(OnModified)(THIS_ DISPID = DISPID_UNKNOWN) PURE;
};

typedef IUcadBaseObject2* LPUCADBASEOBJECT2;

DEFINE_GUID(IID_IRetrieveApplication, 
0x810d2e0f, 0xd7f9, 0x4e3a, 0x8c, 0x85, 0x60, 0x1b, 0x9a, 0x66, 0xe6, 0xa0);

interface DECLSPEC_UUID("810D2E0F-D7F9-4E3A-8C85-601B9A66E6A0") 
IRetrieveApplication : public IUnknown
{
    
    STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID* ppvObj) PURE;
    STDMETHOD_(ULONG, AddRef)(THIS) PURE;
    STDMETHOD_(ULONG, Release)(THIS) PURE;

    STDMETHOD(SetApplicationObject)(THIS_ LPDISPATCH pAppDisp) PURE;
    STDMETHOD(GetApplicationObject)(THIS_ LPDISPATCH* pAppDisp) PURE;
};

typedef IRetrieveApplication* LPRETRIEVEAPPLICATION;

DEFINE_GUID(IID_IUcadBaseDatabase, 
0x9cc45791, 0x9df5, 0x48db, 0xb2, 0x8f, 0x12, 0xba, 0x4e, 0x50, 0x92, 0x25);

interface DECLSPEC_UUID("9CC45791-9DF5-48DB-B28F-12BA4E509225") 
IUcadBaseDatabase : public IUnknown
{
    
    STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID* ppvObj) PURE;
    STDMETHOD_(ULONG, AddRef)(THIS) PURE;
    STDMETHOD_(ULONG, Release)(THIS) PURE;

    STDMETHOD(SetDatabase)(THIS_ UcDbDatabase*& pDb) PURE;
    STDMETHOD(GetDatabase)(THIS_ UcDbDatabase** pDb) PURE;
    STDMETHOD(GetClassID)(THIS_ CLSID& clsid) PURE;
};

typedef IUcadBaseDatabase* LPUCADBASEDATABASE;

DEFINE_GUID(IID_IIMetaColorSuppressor, 
0x9e2c8e3c, 0xd8a6, 0x4917, 0x81, 0xee, 0xaf, 0x88, 0x13, 0x3c, 0x1d, 0xeb);

interface DECLSPEC_UUID("9E2C8E3C-D8A6-4917-81EE-AF88133C1DEB")
IMetaColorSuppressor : public IUnknown
{
    
    STDMETHOD(GetSuppressor)(THIS_ bool* val) PURE;
    STDMETHOD(SetSuppressor)(THIS_ bool val) PURE;
};

typedef IMetaColorSuppressor* LPMETACOLORSUPPRESSOR;

DEFINE_GUID(IID_IUcadUcCmColorAccess,
0x4b363b98, 0xf861, 0x41d9, 0x9f, 0xf1, 0xa9, 0xd4, 0x7e, 0xa7, 0xca, 0x63);

#undef INTERFACE
#define INTERFACE IUcadUcCmColorAccess

interface DECLSPEC_UUID("4B363B98-F861-41D9-9FF1-A9D47EA7CA63")
IUcadUcCmColorAccess : public IUnknown
{
    
    STDMETHOD(GetUcCmColor)(THIS_ UcCmColor* clr) PURE;
    STDMETHOD(SetUcCmColor)(THIS_ UcCmColor* clr) PURE;
};

typedef IUcadUcCmColorAccess* LPUCADUCCMCOLORACCESS;
DEFINE_GUID(IID_IUcadBaseSubEntity,
0xb374d885, 0xeece, 0x4138, 0x8c, 0x82, 0x3f, 0xb2, 0xc, 0x53, 0x87, 0x88);

#undef INTERFACE
#define INTERFACE IUcadBaseSubEntity

interface DECLSPEC_UUID("B374D885-EECE-4138-8C82-3FB20C538788")
IUcadBaseSubEntity : public IUnknown
{

    STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID FAR* ppvObj) PURE;
    STDMETHOD_(ULONG, AddRef)(THIS) PURE;
    STDMETHOD_(ULONG, Release)(THIS) PURE;
    STDMETHOD(OnModified)() PURE;
    STDMETHOD(SetFullSubEntPath)(THIS_ UcDbFullSubentPath& subentPath) PURE;
    STDMETHOD(GetFullSubEntPath)(THIS_ UcDbFullSubentPath* subentPath) PURE;
    STDMETHOD(GetClassID)(THIS_ CLSID& clsid) PURE;
};

typedef IUcadBaseSubEntity* LPUCADSUBENTITY;

HRESULT ZXAUTOEXP 
UcAxErase(UcDbObjectId& objId);

HRESULT ZXAUTOEXP 
UcAxSetXData(UcDbObjectId& objId, VARIANT type, VARIANT data);

HRESULT ZXAUTOEXP 
UcAxGetXData(UcDbObjectId& objId, BSTR bstrName, VARIANT* type, VARIANT* data);

HRESULT ZXAUTOEXP 
UcAxGetObjectName(UcDbObjectId& objId, BSTR* pName);

HRESULT ZXAUTOEXP 
UcAxGetHandle(UcDbObjectId& objId, BSTR* pHandle);

HRESULT ZXAUTOEXP 
UcAxGetColor(UcDbObjectId& objId, UcColor* pColor);

HRESULT ZXAUTOEXP 
UcAxPutColor(UcDbObjectId& objId, UcColor color);

HRESULT ZXAUTOEXP
UcAxGetTrueColor(UcDbObjectId& objId, IUcadUcCmColor** pColor);

HRESULT ZXAUTOEXP 
UcAxPutTrueColor(UcDbObjectId& objId, IUcadUcCmColor* color);

HRESULT ZXAUTOEXP 
UcAxGetLayer(UcDbObjectId& objId, BSTR* pLayer);

HRESULT ZXAUTOEXP 
UcAxPutLayer(UcDbObjectId& objId, BSTR layer);

HRESULT ZXAUTOEXP 
UcAxGetLinetype(UcDbObjectId& objId, BSTR* pLinetype);

HRESULT ZXAUTOEXP 
UcAxPutLinetype(UcDbObjectId& objId, BSTR linetype);

HRESULT ZXAUTOEXP 
UcAxGetTransparency(UcDbObjectId& objId, BSTR* pTransparency);

HRESULT ZXAUTOEXP 
UcAxPutTransparency(UcDbObjectId& objId, BSTR transparency);

HRESULT ZXAUTOEXP
UcAxGetShadowDisplay(UcDbObjectId& objId, UcShadowDisplayType* pShadowDisplay);

HRESULT ZXAUTOEXP
UcAxPutShadowDisplay(UcDbObjectId& objId, UcShadowDisplayType shadowDisplay);

HRESULT ZXAUTOEXP
UcAxEnableShadowDisplay(UcDbObjectId& objId, bool* pEnabled);

HRESULT ZXAUTOEXP
UcAxGetMaterial(UcDbObjectId& objId, BSTR* pMaterial);

HRESULT ZXAUTOEXP
UcAxPutMaterial(UcDbObjectId& objId, BSTR material);

HRESULT ZXAUTOEXP 
UcAxGetLinetypeScale(UcDbObjectId& objId, double* pLinetypeScale);

HRESULT ZXAUTOEXP 
UcAxPutLinetypeScale(UcDbObjectId& objId, double linetypeScale);

HRESULT ZXAUTOEXP 
UcAxGetVisible(UcDbObjectId& objId, VARIANT_BOOL* pVisible);

HRESULT ZXAUTOEXP 
UcAxPutVisible(UcDbObjectId& objId, VARIANT_BOOL visible);

HRESULT ZXAUTOEXP 
UcAxArrayPolar(UcDbObjectId& objId, LPDISPATCH pAppDisp, int numObjs, 
               double fillAngle, VARIANT basePoint, VARIANT* pArrayObjs);

HRESULT ZXAUTOEXP 
UcAxArrayRectangular(UcDbObjectId& objId, LPDISPATCH pAppDisp, int numRows, 
                     int numCols, int numLvls, double disRows, double disCols,
                     double disLvls, VARIANT* pArrayObjs);

HRESULT ZXAUTOEXP 
UcAxHighlight(UcDbObjectId& objId, VARIANT_BOOL bHighlight);

HRESULT ZXAUTOEXP 
UcAxCopy(UcDbObjectId& objId, LPDISPATCH pAppDisp, LPDISPATCH* pCopyObj, 
         UcDbObjectId ownerId = UcDbObjectId::kNull);

HRESULT ZXAUTOEXP 
UcAxMove(UcDbObjectId& objId, VARIANT fromPoint, VARIANT toPoint);

HRESULT ZXAUTOEXP 
UcAxRotate(UcDbObjectId& objId, VARIANT basePoint, double rotationAngle);

HRESULT ZXAUTOEXP 
UcAxRotate3D(UcDbObjectId& objId, VARIANT point1, VARIANT point2, 
             double rotationAngle);

HRESULT ZXAUTOEXP 
UcAxMirror(UcDbObjectId& objId, LPDISPATCH pAppDisp, VARIANT point1, 
           VARIANT point2, LPDISPATCH* pMirrorObj);

HRESULT ZXAUTOEXP 
UcAxMirror3D(UcDbObjectId& objId, LPDISPATCH pAppDisp, VARIANT point1, 
             VARIANT point2, VARIANT point3, LPDISPATCH* pMirrorObj);

HRESULT ZXAUTOEXP 
UcAxScaleEntity(UcDbObjectId& objId, VARIANT basePoint, double scaleFactor);

HRESULT ZXAUTOEXP 
UcAxTransformBy(UcDbObjectId& objId, VARIANT transMatrix);

HRESULT ZXAUTOEXP 
UcAxUpdate(UcDbObjectId& objId);

HRESULT ZXAUTOEXP 
UcAxGetBoundingBox(UcDbObjectId& objId, VARIANT* minPoint, VARIANT* maxPoint);

HRESULT ZXAUTOEXP 
UcAxIntersectWith(UcDbObjectId& objId, LPDISPATCH pEntity, 
                  UcExtendOption option, VARIANT* intPoints);

HRESULT ZXAUTOEXP 
UcAxGetPlotStyleName(UcDbObjectId& objId, BSTR* plotStyleName);

HRESULT ZXAUTOEXP 
UcAxPutPlotStyleName(UcDbObjectId& objId, BSTR plotStyleName);

HRESULT ZXAUTOEXP 
UcAxGetLineWeight(UcDbObjectId& objId, UCAD_LWEIGHT* lineWeight);

HRESULT ZXAUTOEXP 
UcAxPutLineWeight(UcDbObjectId& objId, UCAD_LWEIGHT lineWeight);

HRESULT ZXAUTOEXP 
UcAxGetHyperlinks(UcDbObjectId& objId, LPDISPATCH pAppDisp, 
                  IUcadHyperlinks** pHyperlinks);

HRESULT ZXAUTOEXP 
UcAxHasExtensionDictionary(UcDbObjectId& objId, VARIANT_BOOL* bHasDictionary);

HRESULT ZXAUTOEXP 
UcAxGetExtensionDictionary(UcDbObjectId& objId, LPDISPATCH pAppDisp, 
                           IUcadDictionary** pExtDictionary);

HRESULT ZXAUTOEXP 
UcAxGetDatabase(UcDbDatabase* pDb, LPDISPATCH pAppDisp, LPDISPATCH* pDisp);

HRESULT ZXAUTOEXP
UcAxGetOwnerId(UcDbObjectId& objId, ZSoft::IntDbId * pOwnerId);

#if defined(_WIN64) || defined(_UC64)
ZSoft::Int32 ZXAUTOEXP
UcAxGetObjectId32(const ZSoft::IntDbId& objId);

ZSoft::IntDbId ZXAUTOEXP
UcAxGetObjectId64(const ZSoft::Int32& objId);
#endif

HRESULT ZXAUTOEXP
RaiseUcAXException(REFGUID iid, HRESULT hRes, DWORD dwException, ...);

HRESULT  ZXAUTOEXP
RaiseZrxException(REFGUID iid, HRESULT hRes, Ucad::ErrorStatus es);

HRESULT ZXAUTOEXP
UcAxGetIUnknownOfObject(LPUNKNOWN* ppUnk, UcDbObjectId& objId, LPDISPATCH pApp);

HRESULT ZXAUTOEXP
UcAxGetIUnknownOfObject(LPUNKNOWN* ppUnk, UcDbObject* pObj, LPDISPATCH pApp);

HRESULT ZXAUTOEXP 
UcAxErase(UcAxObjectRef& objRef);

HRESULT ZXAUTOEXP 
UcAxSetXData(UcAxObjectRef& objRef, VARIANT type, VARIANT data);

HRESULT ZXAUTOEXP 
UcAxGetXData(UcAxObjectRef& objRef, BSTR bstrName, VARIANT* type, VARIANT* data);

HRESULT ZXAUTOEXP 
UcAxGetObjectName(UcAxObjectRef& objRef, BSTR* pName);

HRESULT ZXAUTOEXP 
UcAxGetHandle(UcAxObjectRef& objRef, BSTR* pHandle);

HRESULT ZXAUTOEXP 
UcAxGetColor(UcAxObjectRef& objRef, UcColor* pColor);

HRESULT ZXAUTOEXP 
UcAxPutColor(UcAxObjectRef& objRef, UcColor color);

HRESULT ZXAUTOEXP
UcAxGetTrueColor(UcAxObjectRef& objRef, IUcadUcCmColor** pColor); 
                                                                  
HRESULT ZXAUTOEXP                                                 
UcAxPutTrueColor(UcAxObjectRef& objRef, IUcadUcCmColor* color);   

HRESULT ZXAUTOEXP 
UcAxGetLayer(UcAxObjectRef& objRef, BSTR* pLayer);

HRESULT ZXAUTOEXP 
UcAxPutLayer(UcAxObjectRef& objRef, BSTR layer);

HRESULT ZXAUTOEXP 
UcAxGetLinetype(UcAxObjectRef& objRef, BSTR* pLinetype);

HRESULT ZXAUTOEXP 
UcAxPutLinetype(UcAxObjectRef& objRef, BSTR linetype);

HRESULT ZXAUTOEXP 
UcAxGetMaterial(UcAxObjectRef& objRef, BSTR* pMaterial);

HRESULT ZXAUTOEXP 
UcAxGetTransparency(UcAxObjectRef& objRef, BSTR* pTransparency);

HRESULT ZXAUTOEXP 
UcAxPutTransparency(UcAxObjectRef& objRef, BSTR transparency);


HRESULT ZXAUTOEXP
UcAxPutMaterial(UcAxObjectRef& objRef, BSTR material);

HRESULT ZXAUTOEXP
UcAxGetLinetypeScale(UcAxObjectRef& objRef, double* pLinetypeScale);

HRESULT ZXAUTOEXP 
UcAxPutLinetypeScale(UcAxObjectRef& objRef, double linetypeScale);

HRESULT ZXAUTOEXP
UcAxGetShadowDisplay(UcAxObjectRef& objRef, UcShadowDisplayType* pShadowDisplay);

HRESULT ZXAUTOEXP
UcAxPutShadowDisplay(UcAxObjectRef& objRef, UcShadowDisplayType shadowDisplay);

HRESULT ZXAUTOEXP
UcAxEnableShadowDisplay(UcAxObjectRef& objRef, bool* pEnabled);

HRESULT ZXAUTOEXP 
UcAxGetVisible(UcAxObjectRef& objRef, VARIANT_BOOL* pVisible);

HRESULT ZXAUTOEXP 
UcAxPutVisible(UcAxObjectRef& objRef, VARIANT_BOOL visible);

HRESULT ZXAUTOEXP 
UcAxArrayPolar(UcAxObjectRef& objRef, LPDISPATCH pAppDisp, int numObjs, 
               double fillAngle, VARIANT basePoint, VARIANT* pArrayObjs);

HRESULT ZXAUTOEXP 
UcAxArrayRectangular(UcAxObjectRef& objRef, LPDISPATCH pAppDisp, int numRows, 
                     int numCols, int numLvls, double disRows, double disCols,
                     double disLvls, VARIANT* pArrayObjs);

HRESULT ZXAUTOEXP 
UcAxHighlight(UcAxObjectRef& objRef, VARIANT_BOOL bHighlight);

HRESULT ZXAUTOEXP 
UcAxCopy(UcAxObjectRef& objRef, LPDISPATCH pAppDisp, LPDISPATCH* pCopyObj, 
         UcDbObjectId ownerId = UcDbObjectId::kNull);
HRESULT ZXAUTOEXP 
UcAxMove(UcAxObjectRef& objRef, VARIANT fromPoint, VARIANT toPoint);

HRESULT ZXAUTOEXP 
UcAxRotate(UcAxObjectRef& objRef, VARIANT basePoint, double rotationAngle);

HRESULT ZXAUTOEXP 
UcAxRotate3D(UcAxObjectRef& objRef, VARIANT point1, VARIANT point2, 
             double rotationAngle);

HRESULT ZXAUTOEXP 
UcAxMirror(UcAxObjectRef& objRef, LPDISPATCH pAppDisp, VARIANT point1, 
           VARIANT point2, LPDISPATCH* pMirrorObj);

HRESULT ZXAUTOEXP 
UcAxMirror3D(UcAxObjectRef& objRef, LPDISPATCH pAppDisp, VARIANT point1, 
             VARIANT point2, VARIANT point3, LPDISPATCH* pMirrorObj);

HRESULT ZXAUTOEXP 
UcAxScaleEntity(UcAxObjectRef& objRef, VARIANT basePoint, double scaleFactor);

HRESULT ZXAUTOEXP 
UcAxTransformBy(UcAxObjectRef& objRef, VARIANT transMatrix);

HRESULT ZXAUTOEXP 
UcAxUpdate(UcAxObjectRef& objRef);

HRESULT ZXAUTOEXP 
UcAxGetBoundingBox(UcAxObjectRef& objRef, VARIANT* minPoint, VARIANT* maxPoint);

HRESULT ZXAUTOEXP 
UcAxIntersectWith(UcAxObjectRef& objRef, LPDISPATCH pEntity, 
                  UcExtendOption option, VARIANT* intPoints);

HRESULT ZXAUTOEXP 
UcAxGetPlotStyleName(UcAxObjectRef& objRef, BSTR* plotStyleName);

HRESULT ZXAUTOEXP 
UcAxPutPlotStyleName(UcAxObjectRef& objRef, BSTR plotStyleName);

HRESULT ZXAUTOEXP 
UcAxGetLineWeight(UcAxObjectRef& objRef, UCAD_LWEIGHT* lineWeight);

HRESULT ZXAUTOEXP 
UcAxPutLineWeight(UcAxObjectRef& objRef, UCAD_LWEIGHT lineWeight);

HRESULT ZXAUTOEXP 
UcAxGetHyperlinks(UcAxObjectRef& objRef, LPDISPATCH pAppDisp, 
                  IUcadHyperlinks** pHyperlinks);

HRESULT ZXAUTOEXP 
UcAxHasExtensionDictionary(UcAxObjectRef& objRef, VARIANT_BOOL* bHasDictionary);

HRESULT ZXAUTOEXP 
UcAxGetExtensionDictionary(UcAxObjectRef& objRef, LPDISPATCH pAppDisp, 
                           IUcadDictionary** pExtDictionary);
HRESULT ZXAUTOEXP
UcAxGetOwnerId(UcAxObjectRef& objRef, ZSoft::IntDbId * pOwnerId);
#endif

#endif
